package com.timk.goserver.client.ui.widgets;

import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Widget;
import com.timk.goserver.client.ui.screens.GraphDialog;

/**
 * RankGraphLink is a link to open the RankGraphDialog
 * 
 * @author TKington
 *
 */
public class RankGraphLink extends HTML {
	String username;	// NOPMD - explicit scoping
	
	/**
	 * Creates a RankGraphLink
	 * 
	 * @param username the user whose rating will be graphed
	 */
	public RankGraphLink(String username) {
		this.username = username;
		
		addClickListener(new ClickListener() {
			public void onClick(Widget sender) {
				GraphDialog dlg = new GraphDialog(
						RankGraphLink.this.username);
				dlg.show();
			}
		});
	}
}
